package smartcarpool.ui;

import android.app.ActionBar.Tab;
import android.app.ActionBar.TabListener;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.util.Log;

public class SCTabListener implements TabListener {

	private ViewPager vPager;

	/*public SCTabListener(Fragment fragment) {
		this.mFragment = fragment;
	}*/
	public SCTabListener(ViewPager vPager) {
		this.vPager = vPager;
	}

	@Override
	public void onTabReselected(Tab tab, FragmentTransaction ft) {
		// TODO Auto-generated method stub
	//	Log.d("App Info", "Tab Reselected");
	}

	@Override
	public void onTabSelected(Tab tab, FragmentTransaction ft) {
		//Log.d("App Info", "Tab Selected");
		//ft.show(mFragment);
		vPager.setCurrentItem(tab.getPosition());
	}

	@Override
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		//Log.d("App Info", "Tab Unselected");
		//ft.hide(mFragment);
	}
}
